CANSelectDevice
    show a Dialog that show all CAN Port on system, and App can select a CAN Port on system.
    a CAN Device has a Port Number, and the Port Number is also a DevNum.
        The range of Port Number is from 0 to 7. (this can be changed)
        Port Number from 0 to 3 is dedicated to LPC CAN Devices.
        Port Number from 4 to 7 is dedicated to PCI CAN Devices.

    The Name String of CAN Device is \\.\CAN{i}. i is Port Number.
    If there is two PCIE CAN Card and each have two port, the CAN Devices is
        \\.\CAN4 and \\.\CAN5 for first PCIE CAN Card
        \\.\CAN6 and \\.\CAN7 for second PCIE CAN Card

CANPortOpen()
    input DevNum(also as a Port Number), App can select this CAN Device to open.
    output wPort, it reports the DevNum if success.
    output wHostID, it reports the DevNum  if success.
    output wBaudRate, it always reports 1000(K) if success.

CANPortClose    
    This function will Stop CAN Controller and Close CAN Port.

CANSetProtocolType
    CANBUS_PROTOCOL_20A and CANBUS_PROTOCOL_20B

CANHwReset()
    This function will do the following actions.
        Stop CAN Controller
        Reset CAN Controller
    so after HwReset, App should re configure CAN Port.

CANInit()
    BTR0,
    BTR1,
    ucMask, it do nothing. the Interrupts of RDC CAN are alwasy enable.

    125k 0x03 0x1c
    250k 0x01 0x1c  
    500k 0x00 0x1c  
    800k 0x00 0x07
    1000k 0x00  0x05
    
CANSetOutCtrl()
    we do not support this.
    it do nothing, and always return success.
    
CANSetAcp()
    we do not support this.
    it do nothing, and always return success.
    
CANSetAcpEx()
    we do not support this.
    it do nothing, and always return success.

CANSetBaud
    BTR0,
    BTR1,
    
CANGetBaudRate
    BaudRate, its unit is KHz.
   
CANSetNormal
    App call this funciton to Start CAN Controller and Receive CAN Messages.

CANEnableRxInt
    we dont support this behavior.
    it do nothing, and always return success.
    The Interrupts of RDC CAN is alwasy enabled.

CANReadFile
    the message format is CAN_MSG_T or CAN_MSG_T_EX depended on ProtocolType.
    This function can read more the one messages.
    
CANWriteFile
    the message format is CAN_MSG_T or CAN_MSG_T_EX depended on ProtocolType.
    This function send one message.


CANSetBufferPtr
CANSetCountPtr

CANEnableEvent
    enable(or start) Receiving FIFO Mode
    disable(or stop) Receiving FIFO Mode

CANWaitForFIFOEvent
    PS: After CANWaitForFIFOEvent with Full Event, App should CANEnableEvent re enable its FIFO Mode.


We can this mode is Receiving FIFO Mode.
1. before starting this mode, App should set FIFO buffer and set FIFO Count.
   CANSetBufferPtr (check bReady report)
   CANSetCountPtr (check bReady report)

2. to starting this mode, call CANEnableEvent with enable.
   now we create a thread to read CAN Message and put into FIFO buffer and record FIFO count.
   when FIFO is Half Full, a Half Full event is signaled.
   when FIFO is Full, a Full event is signaled, then FIFO mode is stop.

3. using CANWaitForFIFOEvent to check FIFO state.
   First calling CANWaitForFIFOEvent is to check Half Full event.
   Second calling CANWaitForFIFOEvent is to check Full event.
   After Full event is signaled, the FIFO mode is stop.
   
4. APP can re start Receiving FIFO Mode, just call CANEnableEvent with enable.

   CANSetBufferPtr 

   CANSetCountPtr 
   
   while(1)
   {
      call CANEnableEvent with enable to (re) start FIFO Mode.

      call CANWaitForFIFOEvent to check Half Full event
      call CANWaitForFIFOEvent to check Full event
      dump CAN Message form FIFO Buffer.
   }

   

